#if IN_HEADER(__GTK_TEXT_TYPES_H__)
#if IN_FILE(__GTK_TEXT_TYPES_C__)
+gtk_text_unknown_char_utf8_gtk_tests_only
gtk_text_byte_begins_utf8_char
#endif
#endif
gtk_info_bar_get_message_type
#endif
#endif
-
-#ifdef INCLUDE_VARIABLES
-gtk_text_attr_appearance_type
-gtk_text_char_type
-gtk_text_child_type
-gtk_text_left_mark_type
-gtk_text_pixbuf_type
-gtk_text_right_mark_type
-gtk_text_toggle_off_type
-gtk_text_toggle_on_type
-gtk_text_unknown_char_utf8
-#endif
if (copy)
{
g_string_append_len (string,
- gtk_text_unknown_char_utf8,
- 3);
+ _gtk_text_unknown_char_utf8,
+ GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN);
}
}
seg->next = NULL;
- seg->byte_count = 3; /* We convert to the 0xFFFC "unknown character",
- * a 3-byte sequence in UTF-8
- */
+ /* We convert to the 0xFFFC "unknown character",
+ * a 3-byte sequence in UTF-8.
+ */
+ seg->byte_count = GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN;
seg->char_count = 1;
seg->body.pixbuf.pixbuf = pixbuf;
size_only, FALSE);
add_pixbuf_attrs (layout, display, style,
seg, attrs, layout_byte_offset);
- memcpy (text + layout_byte_offset, gtk_text_unknown_char_utf8,
+ memcpy (text + layout_byte_offset, _gtk_text_unknown_char_utf8,
seg->byte_count);
layout_byte_offset += seg->byte_count;
buffer_byte_offset += seg->byte_count;
size_only, FALSE);
add_child_attrs (layout, display, style,
seg, attrs, layout_byte_offset);
- memcpy (text + layout_byte_offset, gtk_text_unknown_char_utf8,
+ memcpy (text + layout_byte_offset, _gtk_text_unknown_char_utf8,
seg->byte_count);
layout_byte_offset += seg->byte_count;
buffer_byte_offset += seg->byte_count;
guint cursor_at_line_end : 1;
};
+#ifdef GTK_COMPILATION
extern PangoAttrType gtk_text_attr_appearance_type;
+#endif
GType gtk_text_layout_get_type (void) G_GNUC_CONST;
/* These are used to represent embedded non-character objects
* if you return a string representation of a text buffer
*/
-const gchar gtk_text_unknown_char_utf8[] = { '\xEF', '\xBF', '\xBC', '\0' };
+const gchar _gtk_text_unknown_char_utf8[] = { '\xEF', '\xBF', '\xBC', '\0' };
+
+/* This is to be used only by libgtk test programs */
+const gchar *
+gtk_text_unknown_char_utf8_gtk_tests_only (void)
+{
+ return _gtk_text_unknown_char_utf8;
+}
static inline gboolean
inline_byte_begins_utf8_char (const gchar *byte)
* Declarations for variables shared among the text-related files:
*/
-#ifdef G_OS_WIN32
-#ifdef GTK_COMPILATION
-#define VARIABLE __declspec(dllexport)
-#else
-#define VARIABLE extern __declspec(dllimport)
-#endif
-#else
-#define VARIABLE extern
-#endif
-
/* In gtktextbtree.c */
extern const GtkTextLineSegmentClass gtk_text_char_type;
extern const GtkTextLineSegmentClass gtk_text_toggle_on_type;
*/
#define GTK_TEXT_UNKNOWN_CHAR 0xFFFC
-VARIABLE const gchar gtk_text_unknown_char_utf8[];
+#define GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN 3
+const gchar *gtk_text_unknown_char_utf8_gtk_tests_only (void);
+const gchar _gtk_text_unknown_char_utf8[GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN+1];
gboolean gtk_text_byte_begins_utf8_char (const gchar *byte);
gunichar ch;
/* Check UTF8 unknown char thing */
- g_assert (g_utf8_strlen (gtk_text_unknown_char_utf8, 3) == 1);
- ch = g_utf8_get_char (gtk_text_unknown_char_utf8);
+ g_assert (GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN == 3);
+ g_assert (g_utf8_strlen (gtk_text_unknown_char_utf8_gtk_tests_only (), 3) == 1);
+ ch = g_utf8_get_char (gtk_text_unknown_char_utf8_gtk_tests_only ());
g_assert (ch == GTK_TEXT_UNKNOWN_CHAR);
}